import {createSlice} from '@reduxjs/toolkit'

// 使用该类型定义初始 state
const initialState = {
    paste: [],
    pasteType: ""
}

const caseReducers = {
    setPaste: (state, action) => {
        state.paste = action.payload
    },
    setPasteType: (state, action) => {
        state.pasteType = action.payload
    }
}

export const bucketSlice = createSlice({
    name: 'bucket',
    initialState,
    reducers: caseReducers
})

export const {setPaste, setPasteType} = bucketSlice.actions

export default bucketSlice.reducer
